<?php

$servername = "127.0.0.1";
$username = "root";
$password = "";
$dbname ="bbs";

// 创建连接
$conn = new mysqli($servername, $username, $password,$dbname);
$conn->query("SET NAMES UTF8");
// 检测连接
if (!$conn) {
    die("连接失败: " . mysqli_connect_error());
}

?>